package com.example.travelservlet.totalPlan.service;

import com.example.travelservlet.entity.TotalPlan;
import com.example.travelservlet.totalPlan.reository.TotalPlanRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
public class TotalPlanServiceImpl implements TotalPlanService{
    @Autowired
    private TotalPlanRepository totalPlanRepository;

    @Override
    public TotalPlan createTotalPlan(TotalPlan totalPlan) {
        totalPlan.setTotalPlanId(UUID.randomUUID().toString());
        return totalPlanRepository.save(totalPlan);
    }

    @Override
    public TotalPlan findTotalPlanByUserId(String userId) {
        return totalPlanRepository.findTotalPlanByUserId(userId);
    }


}
